package com.xuelang.pipeline.artifact.client.resource.dto;

import com.xuelang.pipeline.artifact.client.common.validator.ValidEnum;
import com.xuelang.pipeline.artifact.client.resource.enums.ArtifactToolEnum;
import lombok.*;

import jakarta.validation.constraints.NotEmpty;
import java.util.List;

/**
 * 仓库角色用户DTO
 *
 * @author xiwen.zxg
 * @since 2024/5/15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Builder
public class ArtifactRoleUserDTO {

    /**
     * 仓库UUID
     */
    @NotEmpty(message = "仓库UUID不能为空")
    private String artifactUuid;
    /**
     * 仓库类型.取值范围为GENERIC/DOCKER/MAVEN/NPM
     */
    @NotEmpty(message = "仓库类型不能为空")
    @ValidEnum(enumClass = ArtifactToolEnum.ArtifactTypeEnum.class, message = "仓库类型不能为空.取值范围为GENERIC/DOCKER/MAVEN/NPM")
    private String artifactType;
    /**
     * 仓库管理员列表
     */
    private List<BusinessUserVO> managerList;
    /**
     * 仓库开发人员列表
     */
    private List<BusinessUserVO> developerList;
    /**
     * 仓库普通用户列表
     */
    private List<BusinessUserVO> userList;


    /**
     * 业务用户信息
     */
    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @ToString
    @Builder
    public static class BusinessUserVO {
        /**
         * 业务用户ID
         */
        private String userId;
        /**
         * 业务用户名称
         */
        private String userName;
    }

}
